const http = require('http')
const path = require('path')
const readStaticFile = require('./readStaticFile')
http.createServer( async(req, res) => {
    let urlString = req.url;
    // __dirname--当前文件的无理路径，可以拿到static这层
    let filePAathName = path.join(__dirname, './public', urlString)
    let {data,mimetype} = await readStaticFile(filePAathName, res)
    res.end(data)
}).listen(8080, () => {
    console.log(11);
})